package com.chang.gulimall_auth.vo;

import jakarta.validation.constraints.NotBlank;
import jakarta.validation.constraints.Pattern;
import lombok.Data;
import org.hibernate.validator.constraints.Length;

/**
 * @author: changzhenxi
 * @date: 2024年11月28日 14:15
 * @Version: 1.0
 * @description: 用户注册vo
 */
@Data
public class UserRegisterVo {
    @NotBlank(message = "叫啥名?")
    @Length(min = 1, max = 18, message = "用户名必须为1-18位字符")
    private String userName;
    @NotBlank(message = "没密码咋中?")
    @Length(min = 6, max = 18, message = "密码必须为6-18位字符")
    private String password;
    @Pattern(regexp = "^([A-Za-z0-9_\\-\\.])+\\@([A-Za-z0-9_\\-\\.])+\\.([A-Za-z]{2,4})$")
    @NotBlank(message = "得要邮箱!")
    private String email;
    @NotBlank(message = "验证码不能不填")
    private String code;
}
